<!DOCTYPE html>
<html>

<head>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1">
    <!-- Google Chrome Frame也可以让IE用上Chrome的引擎: -->
    <meta name="renderer" content="webkit">
    <!--国产浏览器高速模式-->
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="author" content="穷在闹市"/>
    <!-- 作者 -->
    <meta name="revised" content="穷在闹市.v3, 2019/05/01"/>
    <!-- 定义页面的最新版本 -->
    <meta name="description" content="网站简介"/>
    <!-- 网站简介 -->
    <meta name="keywords" content="搜索关键字，以半角英文逗号隔开"/>
    <title>穷在闹市出品</title>

    <!-- 公共样式 开始 -->
    <link rel="stylesheet" type="text/css" href="css/base.css">
    <link rel="stylesheet" type="text/css" href="fonts/iconfont.css">
    <script type="text/javascript" src="framework/jquery-1.11.3.min.js"></script>
    <link rel="stylesheet" type="text/css" href="layui/css/layui.css">
    <script type="text/javascript" src="layui/layui.js"></script>
  
     <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
	 <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
    <script src="framework/cframe.js"></script><!-- 仅供所有子页面使用 -->
    <!-- 公共样式 结束 -->

    <style>
        .layui-table img {
            max-width: none;
        }
    </style>

</head>

<body>
<div class="cBody">
    <div class="console">
        <form class="layui-form" action="TypeServiet?action=queryBName" method="post">
            <div class="layui-form-item">
                <div class="layui-input-inline">
                    <input type="text" name="name" required lay-verify="required" placeholder="输入商品名称"
                           autocomplete="off" class="layui-input">
                           
                </div>
                <button class="layui-btn" lay-submit lay-filter="submitBut">检索</button>
            </div>
            <input type="hidden" id="count" value="${page.count}">

        </form>

        <script>
            layui.use('form', function () {
                var form = layui.form;

                //监听提交
                form.on('submit(submitBut)', function (data) {
                    layer.msg(JSON.stringify(data.field));
                    return true;
                });
            });
            
            layui.use('form', function () {
                var form = layui.form;

                //监听提交
                form.on('submit(submitBut)', function (data) {
                    layer.msg(JSON.stringify(data.field));
                    return false;
                });
                
                
            });
        </script>
    </div>

    <table class="layui-table">
        <thead>
        <tr>
        	<th>ID</th>
            <th>学生姓名</th>
            <th>性别</th>
            <th>学生所在班级</th>
            <th>学生出生日期</th>
            <th>学生电话</th>
            <th>学生QQ</th>
            <th>学生微信</th>
            <th>学生户口所在地</th>
            <th>学生现居地址</th>
            <th>紧急联系人</th>
            <th>紧急联系人电话</th>
            <th>学生身份证</th>
            <th>学生籍贯</th>
            <th>学生毕业学校</th>
            <th>学生毕业班级</th>
            <th>学生兴趣爱好</th>
            <th>状态</th>
            <th>操作</th>
        </tr>
        </thead>
        
        <tbody id="tbody">
        <c:forEach var="students" items="${students}">
        <tr>
<<<<<<< HEAD:src/main/webapp/student/student_list.jsp
=======
<<<<<<<<< Temporary merge branch 1
>>>>>>> origin/lyf:src/main/webapp/student_list.jsp
            <td>${attendances.id}</td>
            <td>${attendances.info}</td>
            <td>${attendances.startdata}</td>
            <td>${attendances.enddata}</td>

            <td>${attendances.data}</td>

            <td>${attendances.student.stu_phone}</td>
            <td>${attendances.student.stu_name}</td>
            <td>${attendances.teacher.t_name}</td>
            <td>
                <c:if test="${attendances.stuta==1}">启用</c:if>
                <c:if test="${attendances.stuta==0}">禁用</c:if>
            </td>
            <td>
                <a class="layui-btn layui-btn-xs" href="TypeServiet?action=updatepage&id=${list.id}">修改</a>
                <a class="layui-btn layui-btn-xs" href="TypeServiet?action=delete&id=${list.id}">删除</a>
<<<<<<< HEAD:src/main/webapp/student/student_list.jsp
=======
=========
>>>>>>>>> Temporary merge branch 2
>>>>>>> origin/lyf:src/main/webapp/student_list.jsp
            <td>${students.stuid}</td>
            <td>${students.stuname}</td>
            <td>${students.stusex}</td>
            <td>${students.clas.claname}</td>
            <td>${students.stubirth}</td>
            <td>${students.stuphone}</td>
            <td>${students.stuqq}</td>
            <td>${students.stuwx}</td>
            <td>${students.stuaccount}</td>
            <td>${students.stuadders}</td>
            <td>${students.urgentname}</td>
            <td>${students.urgentphone}</td>
            <td>${students.stucard}</td>
            <td>${students.stunative}</td>
            <td>${students.graschool}</td>
            <td>${students.graclas}</td>
            <td>${students.stuhobby}</td>

            <td>
                <c:if test="${students.stustatus==0}">待审核</c:if>
                <c:if test="${students.stustatus==1}">启用</c:if>
                <c:if test="${students.stustatus==2}">禁用</c:if>
            </td>
            <td>
                <a class="layui-btn layui-btn-xs" href="/student/queryById&stuid=${students.stuid}">修改</a>
                <a class="layui-btn layui-btn-xs" href="/student/UpdateStatus&stustatus=2,stuid=${students.stuid}">删除</a>
            </td>
        </tr>
      </c:forEach>
        </tbody>
    </table>

    <!-- layUI 分页模块 -->
    <div class="h_55"></div>
    <div id="pages"></div>
    <script>
        layui.use('laypage', function () {
            var laypage = layui.laypage;
           // int i=0;
            //总页数大于页码总数
            laypage.render({
                elem: 'pages'
                , count: $("#count").val()
                ,layout: ['count', 'prev', 'page', 'next', 'limit', 'skip']
                ,limit:3
                , limits:['2','5','8']
                , jump: function (obj) {
					    // if(0==i++)return;
					    
					   var curr = obj.curr;
					   var limi = obj.limit;
					   $.ajax({
						   type:"post",
						   url:"TypeServiet?action=ajaxquery",
						   data:{"currentPage":curr,"size":limi},
						   success: function (data) {
							   console.log(data);
							 var js =  JSON.parse(data);
							 console.log(js);
							 var html="";
							for(var i=0;i<js.length;i++){
								html+="<tr>"
								html+="<td>"+js[i].id+"</td>"
								html+="<td>"+js[i].name+"</td>"
								html+="<td>"+js[i].status+"</td>"
								html+="<td><a class='layui-btn layui-btn-xs' href='TypeServiet?action=updatepage&id="+js[i].id+"'>修改</a><a class='layui-btn layui-btn-xs' href='TypeServiet?action=delete&id="+js[i].id+"'>删除</a></td>"
								html+="</tr>"
							}
							$("#tbody").html(html);
						}
					   
					   });
                }
            });
        });

        //修改规格
        function specificationsBut() {
            layui.use('layer', function () {
                var layer = layui.layer;

                //iframe层-父子操作
                layer.open({
                    type: 2,
                    area: ['70%', '60%'],
                    fixed: false, //不固定
                    maxmin: true,
                    content: 'specifications_list.html'
                });
            });

        }

        //修改按钮
        var updateFrame = null;

        function updateBut() {
            layui.use('layer', function () {
                var layer = layui.layer;

                //iframe层-父子操作
                updateFrame = layer.open({
                    title: "商品信息修改",
                    type: 2,
                    area: ['70%', '60%'],
                    scrollbar: false,	//默认：true,默认允许浏览器滚动，如果设定scrollbar: false，则屏蔽
                    maxmin: true,
                    content: 'goods_update.html'
                });
            });

        }
    </script>
</div>
</body>

</html>